﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LucyGrid
{
	/// <summary>
	/// Keeps information about the nodes working with the grid
	/// </summary>
	public class NodeInfo
	{
		/// <summary>
		/// Node identifier
		/// </summary>
		public string Id {get; set;}
		/// <summary>
		/// Node address
		/// </summary>
		public string Address {get; set;}
		/// <summary>
		/// Last connection time
		/// </summary>
		public DateTime Heartbeat;

		public override bool Equals(object obj)
		{
			return obj != null && this.Id == ((NodeInfo)obj).Id;
		}

		public override string ToString()
		{
			return string.Format("{0}:{1}", Id, Address);
		}
	}
}
